//
//  thirdTableViewCell.m
//  xiaoyiNew
//
//  Created by 讯一 on 16/12/27.
//  Copyright © 2016年 讯一. All rights reserved.
//

#import "thirdTableViewCell.h"

#define kWidth self.frame.size.width
#define kHeight self.frame.size.height

#import "thirdbtn.h"

@interface thirdTableViewCell ()

@property thirdbtn *btn;

@end

@implementation thirdTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self tosetui];
    }
    return self;
}

- (void)tosetui{
    
    NSArray * nameArr = @[@"财富",@"现金券",@"易豆"];
    
    NSArray * imgArr = @[@"0元",@"0张",@"0豆"];
    
    _btn = [[thirdbtn alloc] initWithFrame:CGRectMake(0, 0, Screen_Width, self.frame.size.height) WithDataArray:nameArr WithImageArray:imgArr];
    [_btn blockReturnSelectedBtn:^(NSInteger index) {
        
        
        NSLog(@"---- %ld --------",index);
    }];
    
    [self.contentView addSubview:_btn];
    
    
}
- (UIViewController *)viewController
{
    for (UIView* next = [self superview]; next; next = next.superview) {
        UIResponder *nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
    }
    return nil;
}
//点击提交按钮
-(void)buttonPress
{
//    ElectronController *ec=[[ElectronController alloc]init];
//    [[self viewController].navigationController pushViewController: ec animated:YES];
//    [ec release];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
